#include"Shared.hpp"
int main(){
    key_t k = getkey();
    printf("0x%x\n",k);

    int shmid = createshm(k);//创建共享内存
    printf("shmid : %d\n", shmid);
    
    char* p = (char*)attachshm(shmid);//关联
    printf("attach sucess, address p: %p\n",p);

    //使用
    while(true)
    {
        printf("client say: %s\n",p);
        sleep(1);
    }

    detachshm(p);//去关联
    sleep(10);

    delshm(shmid);//删除共享内存
    return 0;
}
